#include "myClient.h"



myClient::myClient(QTcpSocket *client)
{
    this->client = client;

    QObject::connect(client,&QTcpSocket::disconnected,this,&myClient::disconnected);
    QObject::connect(client,&QTcpSocket::readyRead,this,&myClient::readyRead);
}

QHostAddress myClient::peerAddress() const
{
    return client->peerAddress();
}

quint16 myClient::peerPort() const
{
    return client->peerPort();
}

qint64 myClient::read(char *data, qint64 maxSize)
{
    return client->read(data,maxSize);
}

qint64 myClient::write(const char *data, qint64 maxSize)
{
    return client->write(data,maxSize);
}

void myClient::setName(const QString &name)
{
    this->name = name;
}

void myClient::setPath(const QDir &path)
{
    this->path = path;
}

void myClient::setRootpath(const QDir &rootpath)
{
    this->rootpath = rootpath;
}


QString myClient::getName()
{
    return name;
}

QDir myClient::getPath()
{
    return path;
}

QDir myClient::getRootpath()
{
    return rootpath;
}

QFile *myClient::getFile()
{
    return file;
}

void myClient::setFile(const QString &path)
{
    file = new QFile(path);
}

void myClient::delFile()
{
    delete file;
}



